1. Field of the Invention
This invention relates to an image processing apparatus, an image processing method and a storage medium.
2. Related Background Art
Conventionally, processes for extracting a specific subject image from an image include a method in which removal of backgrounds or the area designation of extraction subjects is repeated while selecting areas that have color component values in a predetermined range including pixel values of the point on the subject or background designated by a user (Japanese Patent Application Laid-Open No. 8-7107 and Japanese Patent Application Laid-Open No. 8-16779, etc.), a method in which the degree of color change of an image is examined, thereby determining the color range of a background area to obtain the background area (Japanese Patent Application Laid-Open No. 7-334675), a method in which an image is divided by color quantizing means into areas for each similar color and adjacent areas are integrated for area dividing based on the similarity of space frequency components and color components extracted for each local area (Japanese Patent Application Laid-Open No. 6-149959), and an interested area designation method in which the position of a representative point is set in an image, areas whose optical density of image is almost equal to that at the representative point are selected, and the size of those areas is optionally changed by operation (Japanese Patent Publication No. 7-34219).
In addition, a method in which only a closing curve (or boundary of polygon) is set in such a way that an image portion to be clipped is roughly enclosed to generate a clipped image almost the same in shape as the subject (U.S. Pat. No. 2,642,368 and Japanese Patent Application Laid-Open No. 7-322054), and a method in which the shape of an area is determined by executing an expansion process of generating an initial closing curve inside the subject to be clipped and shifting linearly and outwardly a sampling point location to a characteristic point such as an edge in a radial direction passing through the sampling point from the center (Japanese Patent Application Laid-Open No. 9-6961) are included.
However, the method in which the extraction subject is designated while selecting areas that have color component values in a predetermined range (Japanese Patent Application Laid-Open No. 8-7107 and Japanese Patent Application Laid-Open No. 8-16779) has disadvantages that much effort is needed (such as designation of color component selection ranges and of the points in the extraction subject) in the case where the subject includes local areas having many color components, and where it is difficult to distinguish between the background and the subject by using pixel values alone because the boundary between them is of low contrast.
The method described in Japanese Patent Application Laid-Open No. 7-334675 is subject to constraints that the area of the background should be sufficiently large and the representative color of the background area should be sufficiently different from that of the extraction subject, and is therefore lacking in general versatility.
The method described in Japanese Patent Application Laid-Open No. 6-149959 has disadvantages that extraction accuracy is significantly reduced in the case where the area neighboring the outline of the extraction subject is in a low contrast portion in which the change of color components is gradual and where the changes of both space frequencies and color components are gradual.
The method described in Japanese Patent Publication No. 7-34219 has disadvantages that it is difficult to extract the shape accurately and process speed is low in the case where the area neighboring the boundary between the extraction subject and the background is in an area in which the change of gray values is gradual.
The method based on the proportion of areas having same color components included in the closing curve (U.S. Pat. No. 2,642,368) is apt to result in erroneous extraction such as extraction of background portions in the case where there is an area in the background in the closing curve that has same color as the subject and where the area of the closing curve is twice or more as large as the area to be clipped.
In the method on the basis of subject recognition process and outline recognition process, under the present circumstance, recognition of the subject or recognition of the outline is generally difficult, and there is a precondition for example that the subject can be recognized based on specific color components or that the outline can be recognized due to the absence in the closing curve of the outline of other objects and the like except for the outline of the subject to be clipped, which results in lack of general versatility.
In the area dividing method using an expansion process of the closing curve generated inside the subject to be clipped, although high speed process is possible, there is a disadvantage that it is generally necessary to set a large number of closing curves at the appropriate position in the subject area, and executing the setting automatically is difficult and setting via human intervention requires excess efforts.
The present invention is intended to provide an image extracting method and device and storage medium to solve these problems.
A suitable example of the present invention on the basis of the aforesaid purpose is characterized in that it includes an inputting step of inputting an image, an area dividing step of dividing the image into a plurality of areas based on predetermined characteristic amount to generate dividing data, a representative position designating step of designating on the image a representative position composed of at least one point, a shape changing step of changing a shape of a predetermined continuous area including the representative position by referring to the dividing data, displaying step of displaying the continuous area whose shape is changed, and an extraction area determining step of determining the continuous area after change as an extraction area.
Furthermore, the example is characterized in that it has an inputting step of inputting an image, an area dividing step of dividing the image into a plurality of areas based on a first characteristic amount to generate dividing data, a representative position designating step of designating on the image a representative position composed of at least one point, a shape changing step of changing the shape of a predetermined continuous area including the representative position by referring to at least one of the dividing data and a second characteristic amount, a displaying step of displaying the continuous area whose shape is changed, and an extraction area setting step of setting the continuous area after the change as an extraction area.
By this configuration, in the process of deforming the initial area (including points and lines) and extracting the subject, the rough shape of the extraction subject can be extracted at high speed, and its detailed shape can be obtained with stability and high accuracy.
The shaped changing step refers to dividing data and a predetermined image characteristic amount. The image characteristic amount is for example a color component characteristic amount at each point in the image, a contrast characteristic amount, an edge strength characteristic amount or a texture characteristic amount.
The image characteristic amount referred to at a predetermined point in the image in the shape changing step is a color component characteristic amount in the case where saturation is a predetermined threshold value or more, and is a contrast characteristic amount, an edge strength characteristic amount or a lightness characteristic amount in the case where the saturation is less than a predetermined threshold value. By this, the outline of a subject and a clipped image can be obtained.
The image predetermined characteristic amount referred to at a predetermined point in the image in the shape changing step may be the weighted average amount of a first characteristic amount being a color component at the point and a second characteristic amount being one of a contrast component, an edge strength component and a light component.
The area dividing step includes a step of extracting at least one representative color component characteristic amount at a representative position composed of at least one point in the image, and a labeling step of adding a first labeling value in the case where at least one of each color space distance defined between color component characteristic amount at each point in the image and each representative color component characteristic amount is a predetermined threshold value or less, and adding a second labeling value in the case where the color space distance is larger than the threshold value, thereby generating the labeling data as dividing data.
The area dividing step may also determine a predetermined two valued threshold value based on the histogram of optical density of image and generate as dividing data the two valued data of the image according to the threshold value. By this, the rough shape (or the detailed shape) of the subject can be obtained at high speed and with high accuracy.
The color component characteristic amount may be chromaticity. Thus, the process efficiency can be improved and high accuracy extraction for extracting areas with hue and saturation in the same category is possible.
Furthermore, the example is characterized in that it has an image inputting unit, an area dividing unit for dividing the image inputted by the image inputting unit into a plurality of areas based on predetermined characteristic amount to generate dividing data, a representative position designating unit for designating on the image a representative position composed of at least one point, a shape changing unit for changing the shape of a predetermined continuous area including the representative position by referring to the dividing data, a displaying unit for displaying the continuous area whose shape is changed, and an extraction area determining unit for determining the continuous area after change as an extraction area.
Furthermore, the example is characterized in that it includes of an inputting step of inputting an image, an area dividing step of dividing the image into a plurality of areas based on predetermined characteristic amount to generate dividing data, a representative position designating step of designating on the image a representative position composed of at least one point, a shape changing step of changing the shape of a predetermined continuous area including the representative position by referring to the dividing data, displaying step of displaying the continuous area whose shape is changed, a convergence determining step of determining the convergence of shape changing by the shape changing step, and an extraction area setting step of setting the continuous area after change as an extraction area.
Furthermore, the example is characterized in that it has an inputting unit for inputting an image, area dividing means for dividing the image inputted by the image inputting unit into a plurality of areas based on predetermined characteristic amount to generate dividing data, a designating unit for designating on the image a representative position composed of at least one point, a shape changing unit for changing the shape of a predetermined continuous area including the representative position by referring to the dividing data, a displaying unit for displaying the continuous area whose shape is changed, a convergence determining unit for determining the convergence of the shape changing by the shape changing unit and an extraction area setting unit for setting the continuous area after change as an extraction area.
In a storage medium related to the present invention, the program of the aforesaid image processing method is stored.
The present invention relates to an image processing device and an image processing method and a storage medium that have new functions.
Further functions and features of the present invention will be apparent from the following drawings and examples.